<%@ page pageEncoding="UTF-8"%>
<html>
<head>
	<title>角色管理</title>
</head>
<body>
	<h3>角色管理</h3>
<div style = "background: url(../images/menuBg.png) repeat fixed; height:420px">
	<form id="form">
		<div class="content_head">
			<label>名称</label><input id="queryName" type="text" name="name"/>
			<a href="javascript:void(0)" id="querySubmit" onclick="selectSysrole();" class="commonbtn">查询</a>
			<a href="javascript:void(0)" onclick="openUrl('/user/addSysroleView.do');" class="commonbtn">新增</a>
			<a href="javascript:void(0)" onclick="reset();" class="commonbtn">重置查询条件</a>
		</div>
		<table id="datagrid"></table>
	</form>
</div>
<script type="text/javascript">
$(function(){
	$('#datagrid').datagrid({
	    url:'/user/listSysrole.do',
	    rownumbers:true,
	    height:330,
	    columns:[[
			{field:'id',title:'操作',width:200,align:'center',formatter: function(value,row,index){
				return "<a href='javascript:void(0)' onclick=\"openUrl('/user/updateSysroleView.do?id=" + value + "');\">编辑</a>" +
				"&nbsp; <a href='javascript:void(0)' onclick=\"openUrl('/user/updateSysroleView.do?id=" + value + "&grant=grant');\">授权</a>";
			}},
	        {field:'name',title:'名称',width:200},
	        {field:'remark',title:'备注',width:338}
	    ]],
	    pagination:true
	});
	$('#datagrid').datagrid('getPager').pagination({
		pagePosition:'bottom',
	    pageNumber:1,
	    pageSize:10,
	    pageList:[10,20]
	});
	//设置回车提交
	enterSubmit('querySubmit');
});

function selectSysrole(){
	var name = $("#queryName").val();
	$('#datagrid').datagrid('load', {
		name: name
	});
}

//查询条件清空
function reset(){
	$('#queryName').val("");
	
}
</script>
</body>
</html>
